<template>
  <div class="app-container">
    <el-table :data="list">
      <el-table-column label="车牌号" align="center" prop="CarNo" />
      <el-table-column label="入库件数" align="center" prop="Output_cout" />
      <el-table-column label="出库吨数" align="center" prop="Output_ton" />
      <el-table-column label="订单号" align="center" prop="Order_no" />
      <el-table-column label="出船日" align="center" prop="Chuchuan" />
      <el-table-column label="提单号" align="center" prop="Get_no" />
      <el-table-column label="业务号" align="center" prop="Bus_no" />
      <el-table-column label="仓储费" align="center" prop="Cang_money" />
      <el-table-column label="剩余吨数" align="center" prop="Exist_ton" />
    </el-table>
    <div>
      <span >出库总吨数：{{ totalWight }}吨 </span>
      <span>总费用：{{ totalMoney }}元</span>
    </div>


  </div>
</template>

<script>

export default {
  // 港口公司场地管理进货
  name: "Output",
  props: {
    list: {
      type: Array,
      default: []
    }
  },
  watch: {
    list(newV, old) {
      this.totalMoney = this.gettotlaMoney(this.list, "Cang_money")
      this.totalWight = this.gettotlaMoney(this.list, "Output_ton")
    }
  },
  data() {
    return {
      totalMoney: 0,
      totalWight: 0,

    }

  },

  methods: {
    gettotlaMoney(arr = [], key) {
      let tem = 0;
      arr.forEach(item => {
        tem = tem + parseInt(item[key])
      })
      return tem;
    },
  }

};
</script>
